﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Principal;

namespace Inovout.Security
{
    public class WindowsUserService:IUserService
    {
        public IUser GetByUserName(string userName)
        {
            throw new NotImplementedException();
        }

        public bool Authenticate(IAuthenticatedUser user)
        {
#if DEBUG
            return user.Name.Equals(user.Password);
#else
            throw new NotImplementedException();
#endif
            }

        public IPrincipal GetPrincipal(string userName)
        {
            //今后需使用WindowsUserPrincipal
            return new UserPrincipal(new UserIdentity(new WindowsUser(userName), true));
        }
    }
}
